package cn.inbot.shopadmin.module.robot.view.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

import cn.inbot.shopadmin.R;
import cn.inbot.shopadmin.bean.UserVo;
import cn.inbot.shopadmin.constant.BaseConstants;

/**
 * Created by shisenkun on 2021/5/11.
 */
public class RobotAdapter2 extends BaseQuickAdapter<UserVo, BaseViewHolder> {
    
    public RobotAdapter2(@Nullable List<UserVo> data) {
        super(R.layout.item_robot, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, UserVo item) {
        helper.setText(R.id.tvSerialNumber, item.getRobotSerialNumber());
        switch (item.getRobotModel()) {
            case BaseConstants.ROBOT_MODEL_P1: {
                helper.setText(R.id.tvRobotType, "派宝替身机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_p1_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_P2: {
                helper.setText(R.id.tvRobotType, "派宝替身机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_p1_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_P3: {
                helper.setText(R.id.tvRobotType, "派宝替身机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_p3_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_T1: {
                helper.setText(R.id.tvRobotType, "派宝教育机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_t1_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_T2: {
                helper.setText(R.id.tvRobotType, "派宝教育机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_t1_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_X1: {
                helper.setText(R.id.tvRobotType, "派宝迎宾机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_x1_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
            case BaseConstants.ROBOT_MODEL_X2: {
                helper.setText(R.id.tvRobotType, "派宝迎宾机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_x2_n);
                helper.setGone(R.id.ivCall, false);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
            case BaseConstants.ROBOT_MODEL_X3: {
                helper.setText(R.id.tvRobotType, "派宝迎宾机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_x3_n);
                helper.setGone(R.id.ivCall, true);
                helper.setGone(R.id.ivControl, true);
                helper.setGone(R.id.ivNavigation, true);
                break;
            }
            case BaseConstants.ROBOT_MODEL_W1: {
                helper.setText(R.id.tvRobotType, "派宝物流机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_w1_n);
                helper.setGone(R.id.ivCall, true);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
            case BaseConstants.ROBOT_MODEL_W2: {
                helper.setText(R.id.tvRobotType, "派宝物流机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_w2_n);
                helper.setGone(R.id.ivCall, true);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
            case BaseConstants.ROBOT_MODEL_S2: {
                helper.setText(R.id.tvRobotType, "派宝安保机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_s2_n);
                helper.setGone(R.id.ivCall, true);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
            case BaseConstants.ROBOT_MODEL_S3: {
                helper.setText(R.id.tvRobotType, "派宝安保机器人");
                helper.setImageResource(R.id.ivRobotModel, R.mipmap.ic_robot_model_s3_n);
                helper.setGone(R.id.ivCall, true);
                helper.setGone(R.id.ivControl, false);
                helper.setGone(R.id.ivNavigation, false);
                break;
            }
        }
        addChildClickViewIds(R.id.ivCall, R.id.ivControl, R.id.ivNavigation);
    }
    
}
